package com.icart.entities;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "bi_servitemchn", schema = "ams", catalog = "")
@IdClass(BiServitemchnEntityPK.class)
public class BiServitemchnEntity {
    private long servitemid;
    private long chnid;
    private Timestamp startdate;
    private Timestamp enddate;
    private Integer stat;

    @Id
    @Column(name = "servitemid")
    public long getServitemid() {
        return servitemid;
    }

    public void setServitemid(long servitemid) {
        this.servitemid = servitemid;
    }

    @Id
    @Column(name = "chnid")
    public long getChnid() {
        return chnid;
    }

    public void setChnid(long chnid) {
        this.chnid = chnid;
    }

    @Basic
    @Column(name = "startdate")
    public Timestamp getStartdate() {
        return startdate;
    }

    public void setStartdate(Timestamp startdate) {
        this.startdate = startdate;
    }

    @Basic
    @Column(name = "enddate")
    public Timestamp getEnddate() {
        return enddate;
    }

    public void setEnddate(Timestamp enddate) {
        this.enddate = enddate;
    }

    @Basic
    @Column(name = "stat")
    public Integer getStat() {
        return stat;
    }

    public void setStat(Integer stat) {
        this.stat = stat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BiServitemchnEntity that = (BiServitemchnEntity) o;

        if (servitemid != that.servitemid) return false;
        if (chnid != that.chnid) return false;
        if (startdate != null ? !startdate.equals(that.startdate) : that.startdate != null) return false;
        if (enddate != null ? !enddate.equals(that.enddate) : that.enddate != null) return false;
        if (stat != null ? !stat.equals(that.stat) : that.stat != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (servitemid ^ (servitemid >>> 32));
        result = 31 * result + (int) (chnid ^ (chnid >>> 32));
        result = 31 * result + (startdate != null ? startdate.hashCode() : 0);
        result = 31 * result + (enddate != null ? enddate.hashCode() : 0);
        result = 31 * result + (stat != null ? stat.hashCode() : 0);
        return result;
    }
}
